home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / MWCC03 / EXAMPLES.ZIP / SFXDLG.PAS < prev    next >
Pascal/Delphi Source File  |  1993-08-18  |  4KB  |  162 lines

  1. {**********************************************************************}
  2. {*                                                                    *}
  3. {*          Microworks Sample Application                                        *}
  4. {*                                                                    *}
  5. {*         for Borland Pascal v7.0 and Turbo Pascal for Windows v1.5           *}
  6. {*                                                                    *}
  7. {*     Copyright 1992-93 Jeff Franks (Microworks) Sydney, Australia.  *}
  8. {*                                                                    *}
  9. {*         You are free to use, modify, reproduce and distribute the      *}
  10. {*         Sample Files (and/or any modified version) in any way you      *}
  11. {*         find useful.                                                                *}
  12. {*                                                                    *}
  13. {**********************************************************************}
  14.  
  15. {*** Introduction
  16.  
  17.     Application    := Basic SFX Dialog
  18.  
  19.     Files          := SFXDlg.pas, SFXDlg.res
  20.  
  21.     Units Required := MObjects and MWCC.dll
  22.  
  23.     Tabs           := 2
  24.  
  25.     Screen         := 800 * 600
  26.  
  27.     Date           := August, 1993.
  28.  
  29.     The TSFXDialog object does not support the use of standard menus (menu bars)
  30.     or TScroller scroll bars (ws_VScroll or ws_HScroll).
  31.  
  32.     Warning - Don't overide any inherited methods (not listed here) without first consulting
  33.               the documentation.
  34.  
  35. ***}
  36.  
  37. program SFXDlg;
  38.  
  39. {$R SFXDlg.res}
  40.  
  41. uses WinTypes, WinProcs, MObjects,
  42.          {$IFDEF Ver15}
  43.              WObjects;
  44.          {$ELSE}
  45.              Objects, OWindows, ODialogs;
  46.          {$ENDIF}
  47.  
  48. const
  49.  
  50.     AppName : PChar = 'NewSFXDialog';
  51.  
  52. type
  53.  
  54. PNewSFXApplication = ^TNewSFXApplication;
  55. TNewSFXApplication = object(TApplication)
  56.     procedure InitMainWindow; virtual;
  57. end;
  58.  
  59. PNewSFXDialog = ^TNewSFXDialog;
  60. TNewSFXDialog = object(TSFXDialog)
  61.     constructor Init(AParent: PWindowsObject; AName: PChar);
  62.     destructor Done; virtual;
  63.     function  GetClassName : PChar; virtual;
  64.     procedure SetUpWindow; virtual;
  65.     procedure WMCtlColor (var Msg: TMessage); virtual wm_First + wm_CtlColor;
  66.     procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  67.     procedure WMNCPaint (var Msg: TMessage); virtual wm_First + wm_NCPaint;
  68.     procedure WMNCCalcSize (var Msg: TMessage); virtual wm_First + wm_NCCalcSize;
  69.     procedure WMActivate (var Msg: TMessage); virtual wm_First + wm_Activate;
  70.     procedure WMNCActivate (var Msg: TMessage); virtual wm_First + wm_NCActivate;
  71.     procedure WMActivateApp (var Msg: TMessage); virtual wm_First + wm_ActivateApp;
  72.     procedure WMGetMinMaxInfo (var Msg: TMessage); virtual wm_First + wm_GetMinMaxInfo;
  73. end;
  74.  
  75. {********** TNewSFXApplication **********}
  76.  
  77. procedure TNewSFXApplication.InitMainWindow;
  78. begin
  79.     MainWindow := New(PNewSFXDialog, Init(nil, 'SFXDialog'));
  80. end;
  81.  
  82. {********** TNewSFXDialog **********}
  83.  
  84. constructor TNewSFXDialog.Init(AParent: PWindowsObject; AName: PChar);
  85. begin
  86.     TSFXDialog.Init(AParent, AName);
  87. end;
  88.  
  89. destructor TNewSFXDialog.Done;
  90. begin
  91.     TSFXDialog.Done;
  92. end;
  93.  
  94. function TNewSFXDialog.GetClassName;
  95. begin
  96.     GetClassName := AppName;
  97. end;
  98.  
  99. procedure TNewSFXDialog.SetUpWindow;
  100. var
  101.     X, Y, W, H: Integer;
  102. begin
  103.     TSFXDialog.SetUpWindow;
  104.     X := GetSystemMetrics(sm_CXScreen) div 4;
  105.     Y := GetSystemMetrics(sm_CYScreen) div 4;
  106.     W := GetSystemMetrics(sm_CXScreen) div 2;
  107.     H := GetSystemMetrics(sm_CYScreen) div 2;
  108.     MoveWindow(HWindow, X, Y, W, H, True);
  109.     SetWindowText(Hwindow, 'SpecialFX Dialog');
  110. end;
  111.  
  112. procedure TNewSFXDialog.WMPaint (var Msg: TMessage);
  113. begin
  114.     TSFXDialog.WMPaint(Msg);
  115. end;
  116.  
  117. procedure TNewSFXDialog.WMNCPaint (var Msg: TMessage);
  118. begin
  119.     TSFXDialog.WMNCPaint(Msg);
  120. end;
  121.  
  122. procedure TNewSFXDialog.WMNCCalcSize (var Msg: TMessage);
  123. begin
  124.     TSFXDialog.WMNCCalcSize(Msg);
  125. end;
  126.  
  127. procedure TNewSFXDialog.WMCtlColor (var Msg: TMessage);
  128. begin
  129.     TSFXDialog.WMCtlColor(Msg);
  130. end;
  131.  
  132. procedure TNewSFXDialog.WMActivate (var Msg: TMessage);
  133. begin
  134.     TSFXDialog.WMActivate(Msg);
  135. end;
  136.  
  137. procedure TNewSFXDialog.WMNCActivate (var Msg: TMessage);
  138. begin
  139.     TSFXDialog.WMNCActivate(Msg);
  140. end;
  141.  
  142. procedure TNewSFXDialog.WMActivateApp (var Msg: TMessage);
  143. begin
  144.     TSFXDialog.WMNCActivate(Msg);
  145. end;
  146.  
  147. procedure TNewSFXDialog.WMGetMinMaxInfo (var Msg: TMessage);
  148. begin
  149.     TSFXDialog.WMGetMinMaxInfo(Msg);
  150. end;
  151.  
  152. {********** Main program **********}
  153.  
  154. var
  155.     SFXApp: TNewSFXApplication;
  156. begin
  157.  
  158.     SFXApp.Init(AppName);
  159.     SFXApp.Run;
  160.     SFXApp.Done;
  161. end.
  162.